﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="EditCategory_Forums.aspx.cs" Inherits="NEWS.Admin.EditCategory_Forums" %>
<%@ Register assembly="msgBox" namespace="BunnyBear" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
            function confirmAction()
             {
                if(confirm('Bạn có chắc chắn muốn xóa???'))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            
            function confirmDeleteAllAction()
             {
                if(confirm('Tất cả tin diễn đàn và bình luận theo chủ đề này sẽ bị xóa. \n Bạn chắc chắn muốn xóa chủ đề này ???'))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
    </script>
   <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
        <ContentTemplate>
        <asp:Panel ID="PanelActions" runat="server">
                <div class="dashboard">
                    <h2 class="ico_mug">
                        &nbsp;<asp:Label ID="lbHeaderActions" runat="server" Text="Chuyên mục"></asp:Label>
                    </h2>
                    <div>
                        <table style="width: 100%">
                            <tr>
                                <td style="width: 84px">
                                    &nbsp;
                                </td>
                                <td style="width: 215px">
                                    <asp:Label ID="message" runat="server" Font-Bold="True" Font-Size="Medium" ForeColor="#FF3300"></asp:Label>
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>                               
                                <td style="width: 100px; text-align: right;">
                                    <asp:Label ID="lbmachuyenmuc" runat="server" Text="Mã chuyên mục :"></asp:Label>
                                </td>                                
                                <td style="width: 215px">
                                    <asp:TextBox ID="txtmachuyenmuc" runat="server" Enabled="False"></asp:TextBox>
                                </td>
                                <td style="text-align: left">
                                    <asp:Label ID="lbHeaderActions0" runat="server" Font-Bold="True" Font-Names="Arial Unicode MS"
                                        Font-Size="Medium" Text="Chủ đề"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 84px; text-align: right;">
                                    <asp:Label ID="lbltenchuyenmuc" runat="server" Text="Tên chuyên mục :"></asp:Label>
                                </td>
                                <td style="width: 215px">
                                    <asp:Panel runat="server" ID="pn_textname" Visible="true">
                                        <asp:TextBox ID="txttenchuyenmuc" runat="server" MaxLength="50"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txttenchuyenmuc"
                                            ErrorMessage="?" ValidationGroup="1"></asp:RequiredFieldValidator>
                                    </asp:Panel>
                                    <asp:Panel runat="server" ID="pn_dl" Visible="false">
                                        <asp:DropDownList ID="dltenchuyenmuc" DataTextField="Value" DataValueField="Key" runat="server">
                                        </asp:DropDownList>
                                    </asp:Panel>
                                </td>
                                <td style="border-style: double; text-align: left;">
                                    &nbsp;<asp:ImageButton ID="btnImageThemChuDe" runat="server" ImageUrl="~/Admin/img/add.png"
                                        OnClick="btnImageThemChuDe_Click" CausesValidation="False" />
                                    &nbsp;&nbsp;&nbsp;&nbsp;
                                    <asp:ImageButton ID="btnImageSuaChuDe" runat="server" ImageUrl="~/Admin/img/edit.png"
                                        ToolTip="Edit" OnClick="btnImageSuaChuDe_Click" CausesValidation="False" />
                                    &nbsp;&nbsp;&nbsp;
                                    <asp:ImageButton ID="btnImageXoaChuDe" runat="server" ImageUrl="~/Admin/img/cancel.png"
                                        ToolTip="Delete" OnClientClick="javascript:return confirmDeleteAllAction();" OnClick="btnImageXoaChuDe_Click"
                                        CausesValidation="False" />
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 84px; height: 4px;">
                                    &nbsp;
                                </td>
                                <td style="width: 215px; height: 4px;">
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="txttenchuyenmuc"
                                        ErrorMessage="Độ dài tối đa 50 ký tự" ValidationExpression="^([\S\s]{1,50})$"
                                        ValidationGroup="1"></asp:RegularExpressionValidator>
                                    <br />
                                </td>
                                <td align="left" dir="rtl" rowspan="5" style="vertical-align: top; text-align: right;">
                                    <asp:ListBox ID="listChuDe" runat="server"
                                        Height="201px" DataTextField="SubTopicForumName" DataValueField="SubTopicForumID" Style="margin-right: 12px" Width="98%"></asp:ListBox>
                                </td>
                            </tr>
                            <tr>                          
                                <td style="width: 84px; height: 4px; text-align: right;">
                                    <asp:Label ID="Label3" runat="server" Text="Kích hoạt :"></asp:Label>
                                </td>
                                <td style="width: 215px; height: 4px;">
                                    <asp:CheckBox ID="isActive" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 84px;">
                                </td>
                                <td style="width: 215px;">
                                    <asp:Button ID="btnUpdate" runat="server" OnClick="btnUpdate_Click" Text="Cập nhật"
                                        ValidationGroup="1" />
                                    <asp:Button ID="btnDel" runat="server" OnClick="btnDel_Click" OnClientClick="javascript:return confirmAction();"
                                        Text="Xóa" CausesValidation="False" />
                                    <asp:Button ID="btnAdd" runat="server" OnClick="btnAdd_Click" Text="Thêm" ValidationGroup="1" />
                                    <asp:Button ID="btnTroVe" runat="server" Text="Trở Về" ValidationGroup="1" 
                                        onclick="btnTroVe_Click" />
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 84px; height: 9px;">
                                </td>
                                <td style="height: 9px;">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 84px">
                                    &nbsp;
                                </td>
                                <td style="width: 215px">
                                    &nbsp;
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </asp:Panel>
        <asp:Panel ID="pnChuDe" runat="server" Visible="False">
                <div class="dashboard">
                    <h2 class="ico_mug">
                        &nbsp;<asp:Label ID="lbladdchude" runat="server" Text="Chủ đề của diễn đàn"></asp:Label>
                    </h2>
                    <div>
                        <table style="width: 100%">
                            <tr>
                                <td style="width: 120px">                                    
                                </td>
                                <td style="width: 20px">
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:Label ID="messagedetail" runat="server" Font-Bold="True" Font-Size="Medium"
                                        ForeColor="#FF3300"></asp:Label>
                                </td>
                            </tr>
                            <tr>                             
                                <td style="width: 120px; text-align: right;">
                                    <asp:Label ID="lbMaChuDe" runat="server" Text="Mã chủ đề :"></asp:Label>
                                </td>
                                <td style="width: 20px">
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:TextBox ID="txtMaChuDe" runat="server" Enabled="False"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 120px; text-align: right;">
                                    <asp:Label ID="Label5" runat="server" Text="Tên chủ đề :"></asp:Label>
                                </td>
                                <td style="width: 20px">
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:TextBox ID="txtTenChuDe" runat="server" MaxLength="50"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtTenChuDe"
                                        ErrorMessage="?" ValidationGroup="2"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="txtTenChuDe"
                                        ErrorMessage="Độ dài tối đa 50 ký tự" ValidationExpression="^([\S\s]{1,50})$"
                                        ValidationGroup="2"></asp:RegularExpressionValidator>
                                </td>
                            </tr>
                           <tr>
                                <td style="width: 120px; text-align: right;">
                                    <asp:Label ID="lblmotachude" runat="server" Text="Mô tả chủ đề :"></asp:Label>
                                </td>
                                <td style="width: 20px">
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:TextBox ID="txtmotachude" runat="server" MaxLength="50"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 120px; text-align: right;">
                                <asp:Label ID="Label1" runat="server" Text="Kích hoạt :"></asp:Label>
                                </td>
                                <td style="width: 20px">
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:CheckBox ID="isactiveChuDe" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 120px; text-align: right;">
                                    &nbsp;</td>
                                <td style="width: 20px">
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:Button ID="btnUpdateChuDe" runat="server" OnClick="btnUpdateChuDe_Click" 
                                        Text="Cập nhật" ValidationGroup="2" />
                                    &nbsp;
                                    <asp:Button ID="btnThemChuDe" runat="server" OnClick="btnThemChuDe_Click" 
                                        Text="Thêm" ValidationGroup="2" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    </asp:Content>